import {
  queryGetDemoUrlDetailReq, resetUserTokenReq,
} from './api'

export default {
  namespace: 'apiCall',
  state: {},
  effects: {
    * queryGetDemoUrlDetail({ params, cb }, { call, put }) {
      const res = yield call(queryGetDemoUrlDetailReq, params)
      if (cb) {
        cb(res)
      }
    },
    * resetUserToken({ params, cb }, { call, put }) {
      const res = yield call(resetUserTokenReq, params)
      if (cb) {
        cb(res)
      }
    },
  },
  reducers: {
    save(state, { payload }) {
      return {
        ...state,
        ...payload,
      }
    },
  },
}
